<?php

/*
 * File  : menu.php
 * Table : moduls
 */

session_start();
//cek session

if ((!$_SESSION["USRID"] AND !$_SESSION["USRPASS"])) {
    header("location: index.php");
    exit();
}
//end
?>

<?php

if ($_SESSION["USRLEVEL"] == "admin") {
    $sql = mysql_query("select mod_nama, mod_link from moduls where mod_aktif='Y' order by mod_urutan");
} else {
    $sql = mysql_query("select mod_nama, mod_link from moduls where mod_aktif='Y' order by mod_urutan");
}

echo " <ul class=\"nav\">";
echo "  <li><a href=\"?module=home\" class=\"icon home\"><span>Home</span></a></li>";
echo "  <li class=\"dropdown\"><a href=\"#\">Berita</a>";
echo "   <ul>";
echo "    <li><a href=?module=kategori>Kategori Berita</a></li>";
echo "    <li><a href=?module=berita>Berita</a></li>";
echo "   </ul>";
echo "  </li>";
echo "  <li class=\"dropdown\"><a href=\"#\">Produk</a>";
echo "   <ul>";
echo "    <li><a href=?module=kategori_produk>Kategori Produk</a></li>";
echo "    <li><a href=?module=produk>Produk</a></li>";
echo "   </ul>";
echo "  </li>";
echo "  <li class=\"dropdown\"><a href=\"#\">Galeri</a>";
echo "   <ul>";
echo "    <li><a href=?module=kategori_galeri>Kategori Galeri</a></li>";
echo "    <li><a href=?module=galeri>Galeri</a></li>";
echo "   </ul>";
echo "  </li>";
echo "  <li><a href=logout.php>Logout</a></li>";
echo " </ul>";
?>
